<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 7/8/17
 * Time: 8:33 AM
 */
declare(strict_types=1);


namespace application\module\admin\addon\rbca\model;

use application\module\admin\addon\model\AddonModel;

/**
 * Class RoleModel
 *
 * @property string $name 角色名称
 * @property string $comment 备注
 *
 * @property int $disable 禁用情况
 * @property string $addtime 角色添加时间
 * @property int $pid 父角色ID
 * @property int $orderNo 排序
 *
 *
 * @package application\module\admin\addon\rbca\model
 */
class RoleModel extends AddonModel
{
    protected function tableName()
    {
        return 'role';
    }

    protected function struct(): string
    {
        return "  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID，为0时为顶级',
  `comment` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间 ',
  `orderNo` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排序，越大越靠前',
  `name` varchar(64) NOT NULL,
  `disable` tinyint(255) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name_UNIQUE` (`name`)";
    }

    protected function tablePrefix()
    {
        return 'ws_auth_';
    }
}